<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>コントロールパネル</title>
    <link href="./assets/styles/default.css" rel="stylesheet" />
    <link href="./assets/styles/page/rankform.css" rel="stylesheet" />
    <script src="./assets/scripts/libs/jquery-1.7.1.min.js" type="text/javascript"></script>
    <script src="./assets/scripts/import.js" type="text/javascript"></script>
	<script type="text/javascript">
		$(function() {
			categoryModal({
                            url:"{$smarty.server.SCRIPT_NAME}?op=select_item&category_id=0&TB_iframe=true&height=400&width=500&modal=false",mode:"table",type:"rank"
                        });
		});
	</script>
</head>
<body>

{include file='include/header.inc.html'}

<div id="container">
    <aside id="accordion">
    	<div id="aside_inner">
    		{include file='include/menu.inc.html'}
        </div>
    </aside>
    
    <article>
    	<h2><span>&nbsp;</span>Item<p><a href="javascript:;">Open Plugins</a></p></h2>
        <nav>
            <ul>
            	<li><a href="{$smarty.server.SCRIPT_NAME}"><span>検索</span></a></li>
            	<li><a href="{$smarty.server.SCRIPT_NAME}?op=regist"><span>登録</span></a></li>
            	<li class="active"><a href="{$smarty.server.SCRIPT_NAME}?op=rank"><span>表示設定</span></a></li>
            	<li><a href="{$smarty.server.SCRIPT_NAME}?op=setting"><span>基本設定</span></a></li>
            </ul>
        </nav>
        
        <section id="content">
        
        	<h3>表示設定</h3>
				{if $phase == 'input'}
					<p class="message">内容を確認し、更新ボタンをクリックしてください。</p>
					<form name="fm" action="{$smarty.server.SCRIPT_NAME}" method="post">
                    
                    	<ul class="t_btns">
                            <li class="single refresh"><button type="button" class="chk_update"><em>&nbsp;</em>更新</button></li>
                        </ul>
                    
						<table class="formTable">
                                                    <tbody>
                                                        <tr>
                                                                <th>設定</th>
                                                                <td>
                                                                    <ul class="rank_list">
                                                                            <li id="1"><span>1位</span><input type="text" id="item_name1" name="item[1]" class="text rank" value="{$data[1].item_name}" readonly /><input type="hidden" id="item_id1" name="item_id[1]" value="{$data[1].id}" /><a href="javascript:;" class="del_cell_item btnDel">削除</a></li>
                                                                            <li id="2"><span>2位</span><input type="text" id="item_name2" name="item[2]" class="text rank" value="{$data[2].item_name}" readonly /><input type="hidden" id="item_id2" name="item_id[2]" value="{$data[2].id}" /><a href="javascript:;" class="del_cell_item btnDel">削除</a></li>
                                                                            <li id="3"><span>3位</span><input type="text" id="item_name3" name="item[3]" class="text rank" value="{$data[3].item_name}" readonly /><input type="hidden" id="item_id3" name="item_id[3]" value="{$data[3].id}" /><a href="javascript:;" class="del_cell_item btnDel">削除</a></li>
                                                                            <li id="4"><span>4位</span><input type="text" id="item_name4" name="item[4]" class="text rank" value="{$data[4].item_name}" readonly /><input type="hidden" id="item_id4" name="item_id[4]" value="{$data[4].id}" /><a href="javascript:;" class="del_cell_item btnDel">削除</a></li>
                                                                            <li id="5"><span>5位</span><input type="text" id="item_name5" name="item[5]" class="text rank" value="{$data[5].item_name}" readonly /><input type="hidden" id="item_id5" name="item_id[5]" value="{$data[5].id}" /><a href="javascript:;" class="del_cell_item btnDel">削除</a></li>
                                                                            <li id="6"><span>6位</span><input type="text" id="item_name6" name="item[6]" class="text rank" value="{$data[6].item_name}" readonly /><input type="hidden" id="item_id6" name="item_id[6]" value="{$data[6].id}" /><a href="javascript:;" class="del_cell_item btnDel">削除</a></li>
                                                                            <li id="7"><span>7位</span><input type="text" id="item_name7" name="item[7]" class="text rank" value="{$data[7].item_name}" readonly /><input type="hidden" id="item_id7" name="item_id[7]" value="{$data[7].id}" /><a href="javascript:;" class="del_cell_item btnDel">削除</a></li>
                                                                            <li id="8"><span>8位</span><input type="text" id="item_name8" name="item[8]" class="text rank" value="{$data[8].item_name}" readonly /><input type="hidden" id="item_id8" name="item_id[8]" value="{$data[8].id}" /><a href="javascript:;" class="del_cell_item btnDel">削除</a></li>
                                                                            <li id="9"><span>9位</span><input type="text" id="item_name9" name="item[9]" class="text rank" value="{$data[9].item_name}" readonly /><input type="hidden" id="item_id9" name="item_id[9]" value="{$data[9].id}" /><a href="javascript:;" class="del_cell_item btnDel">削除</a></li>
                                                                            <li id="10"><span>10位</span><input type="text" id="item_name10" name="item[10]" class="text rank" value="{$data[10].item_name}" readonly /><input type="hidden" id="item_id10" name="item_id[10]" value="{$data[10].id}" /><a href="javascript:;" class="del_cell_item btnDel">削除</a></li>
                                                                    </ul>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <th>コメント</th>
                                                                <td>
                                                                        <textarea name="comment" rows="10">{$forms.comment|escape}</textarea>
                                                                </td>
                                                        </tr>
                                                    </tbody>
						</table>
						
						<p class="button">
							<button type="button" id="btn_update" class="submit"><span>更新</span></button>
						</p>
						<input type="hidden" name="forms[category_id]" value="{$forms.category_id}" />
						<input type="hidden" name="forms[type]" value="{$forms.type}" />
						<input type="hidden" name="mode" value="" />
						<input type="hidden" name="rank" id="rank_no" value="" />
					</form>
				{/if}
				{if $phase == 'complete'}
					<p class="message">{$message}</p>
					<ul class="result_btn">
						<li><a href="{$smarty.server.SCRIPT_NAME}?op=rank">設定一覧に戻る</a></li>
						<li><a href="{$smarty.server.SCRIPT_NAME}?op=rankform&category_id={$forms.category_id}&type={$forms.type}">設定した内容を更新する</a></li>
					</ul>
				{/if}
			</section>
    </article>
    
</div>

{include file='include/footer.inc.html'}

</body>
</html>